package cn.hejiang.mamis.core.service.impl;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.hejiang.mamis.core.entity.SysApi;
import cn.hejiang.mamis.core.mapper.SysApiMapper;
import cn.hejiang.mamis.core.service.SysApiService;

@Service
public class SysApiServiceImpl extends ServiceImpl<SysApiMapper, SysApi> implements SysApiService {

	public List<SysApi> getApiList(String sysId) {
		final String prefix = "magic-api/" + sysId;
		return list().stream().filter(i -> i.getFilePath().startsWith(prefix)).collect(Collectors.toList());
	}
}
